<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body,
        ul,
        li {
            margin: 0px;
            padding: 0px;
        }
        
        ul,
        li {
            list-style: none;
        }
        
        .nav {
            width: 800px;
            height: 40px;
            background: pink;
            margin: 20px auto;
        }
        
        .nav ul li {
            float: left;
        }
        
        .nav ul li a {
            display: inline-block;
            height: 30px;
            font: 14px/40px 微软雅黑;
            padding: 0 20px;
            text-decoration: none;
        }
        
        .nav ul li a:hover {
            background: #1d0586;
        }
    </style>
</head>

<body>
    <div class=nav>
        <ul>
            <li>
                <a href="#">百度</a></li>
            <li>
                <a href="#">百度一下</a></li>
            <li>
                <a href="#">百度两下</a></li>
        </ul>

    </div>
</body>

</html>